package com.ruoyi.an.service.impl;

import java.util.List;

import com.ruoyi.an.domain.AnMechanismSettlementInfo;
import com.ruoyi.an.domain.AnMechanismSettlementInfoDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.an.mapper.AnMechanismSettlementMapper;
import com.ruoyi.an.domain.AnMechanismSettlement;
import com.ruoyi.an.service.IAnMechanismSettlementService;

/**
 * 机构佣金Service业务层处理
 * 
 * @author liuzheng
 * @date 2022-11-12
 */
@Service
public class AnMechanismSettlementServiceImpl implements IAnMechanismSettlementService 
{
    @Autowired
    private AnMechanismSettlementMapper anMechanismSettlementMapper;

    @Override
    public List<AnMechanismSettlement> selectOutTradeNoSettlementList(String tradeNo) {
        return anMechanismSettlementMapper.selectOutTradeNoSettlementList(tradeNo);
    }

    /**
     * 查询机构佣金
     * 
     * @param mechanismSettlementId 机构佣金主键
     * @return 机构佣金
     */
    @Override
    public AnMechanismSettlement selectAnMechanismSettlementByMechanismSettlementId(Long mechanismSettlementId)
    {
        return anMechanismSettlementMapper.selectAnMechanismSettlementByMechanismSettlementId(mechanismSettlementId);
    }

    /**
     * 查询机构佣金列表
     * 
     * @param anMechanismSettlement 机构佣金
     * @return 机构佣金
     */
    @Override
    public List<AnMechanismSettlement> selectAnMechanismSettlementList(AnMechanismSettlement anMechanismSettlement)
    {
        return anMechanismSettlementMapper.selectAnMechanismSettlementList(anMechanismSettlement);
    }

    @Override
    public List<AnMechanismSettlementInfoDto> selectAnMechanismSettlementInfoList(List<Long> mechanismIds) {
        return anMechanismSettlementMapper.selectAnMechanismSettlementInfoList(mechanismIds);
    }

    /**
     * 新增机构佣金
     * 
     * @param anMechanismSettlement 机构佣金
     * @return 结果
     */
    @Override
    public int insertAnMechanismSettlement(AnMechanismSettlement anMechanismSettlement)
    {
        return anMechanismSettlementMapper.insertAnMechanismSettlement(anMechanismSettlement);
    }

    /**
     * 修改机构佣金
     * 
     * @param anMechanismSettlement 机构佣金
     * @return 结果
     */
    @Override
    public int updateAnMechanismSettlement(AnMechanismSettlement anMechanismSettlement)
    {
        return anMechanismSettlementMapper.updateAnMechanismSettlement(anMechanismSettlement);
    }

    /**
     * 批量删除机构佣金
     * 
     * @param mechanismSettlementIds 需要删除的机构佣金主键
     * @return 结果
     */
    @Override
    public int deleteAnMechanismSettlementByMechanismSettlementIds(Long[] mechanismSettlementIds)
    {
        return anMechanismSettlementMapper.deleteAnMechanismSettlementByMechanismSettlementIds(mechanismSettlementIds);
    }

    /**
     * 删除机构佣金信息
     * 
     * @param mechanismSettlementId 机构佣金主键
     * @return 结果
     */
    @Override
    public int deleteAnMechanismSettlementByMechanismSettlementId(Long mechanismSettlementId)
    {
        return anMechanismSettlementMapper.deleteAnMechanismSettlementByMechanismSettlementId(mechanismSettlementId);
    }

    @Override
    public List<AnMechanismSettlement> checkSettlement(AnMechanismSettlement anMechanismSettlement) {
        return anMechanismSettlementMapper.checkSettlement(anMechanismSettlement);
    }

    @Override
    public int syncNullUserMechanismSettlementInfos() {
        return anMechanismSettlementMapper.syncNullUserMechanismSettlementInfos();
    }

    @Override
    public int getEffectiveNumberCount(Long mechanismSettlementId) {
        return anMechanismSettlementMapper.getEffectiveNumberCount(mechanismSettlementId).size();
    }
}
